#ifndef YOOHOO_XDATA_XDATAFORM_H
#define YOOHOO_XDATA_XDATAFORM_H

#include "xdata/export.h"
#include "xdata/xdataitem.h"
#include "xdata/xdatareported.h"

namespace yoohoo_xdata {

using namespace yoohoo_xmppcore;

class YOOHOO_XDATA_EXPORT XDataForm : public XDataFieldContainer, public XmppObject {

public:
	enum Type {
		FORM,
		SUBMIT,
		CANCEL,
		RESULT
	};
	XDataForm(XDataForm::Type type = XDataForm::FORM);
	void setTitle(QString title);
	QString title();
	void setInstructions(QString instructions);
	QString instructions();
	void setReported(XDataReported reported);
	XDataReported& reported();
	void setItems(QList<XDataItem> items);
	QList<XDataItem>& items();
	void setType(XDataForm::Type type);
	XDataForm::Type type();
	QString typeString();
	void clear();

	QString toXml();

private:
	XDataForm::Type _type;
	QString _title;
	QString _instructions;
	XDataReported _reported;
	QList<XDataItem> _items;
};

}

#endif
